package main

import (
	"fmt"
	"time"
)

func main() {
	start := time.Now()
	time.Sleep(time.Second * 2)
	end := time.Now()
	delta := end.Sub(start)
	fmt.Printf("longCalculation took this amount of time: %s\n", delta)

	calcTimeDuaration()
}

func calcTimeDuaration() {
	s := time.Now()
	time.Sleep(time.Second * 2)

	d := time.Since(s).Seconds()
	fmt.Println("calcTimeDuaration 耗时：", d)
}
